@import url(./navigation-menu-keyframes.css);

.navigation-menu.basic {
  [data-scope="navigation-menu"][data-part="root"] {
    --arrow-size: 20px;
    --indicator-size: 10px;
  }

  [data-scope="navigation-menu"][data-part="list"] {
    all: unset;
    list-style: none;
    display: flex;

    &[data-orientation="vertical"] {
      flex-direction: column;
    }
  }

  [data-scope="navigation-menu"][data-part="item"] {
    position: relative;
  }

  [data-scope="navigation-menu"][data-part="trigger"] {
    padding: 10px 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    border: 0;
    background: transparent;
    font-size: inherit;
    gap: 4px;

    & > svg {
      transition: rotate 200ms ease;
      width: 14px;
      height: 14px;
    }

    &[data-state="open"] > svg {
      rotate: -180deg;
    }
  }

  [data-scope="navigation-menu"][data-part="link"] {
    padding: 10px 16px;
    font-weight: bold;
    display: block;
    color: inherit;
    text-decoration: none;

    &:hover {
      text-decoration: underline;
    }
  }

  [data-scope="navigation-menu"][data-part="content"] {
    position: absolute;
    top: 100%;
    width: max-content;
    left: 0;
    margin-top: 5px;
    gap: 20px;
    border-radius: 10px;
    background-color: white;
    padding: 20px;
    transform-origin: top left;
    box-shadow:
      0 10px 100px -20px rgba(50, 50, 93, 0.25),
      0 30px 60px -30px rgba(0, 0, 0, 0.3);
    z-index: 1;

    &[dir="rtl"] {
      left: unset;
      right: 0;
      transform-origin: top right;
    }

    &[data-state="open"] {
      animation: nav-menu-scale-in 250ms ease;
    }

    &[data-state="closed"] {
      animation: nav-menu-scale-out 250ms ease;
    }
  }

  /* Indicator + Arrow */

  [data-scope="navigation-menu"][data-part="arrow"] {
    position: relative;
    top: 4px;
    width: var(--arrow-size);
    height: var(--arrow-size);
    background-color: white;
    rotate: 45deg;
    border-radius: 3px;
  }

  [data-scope="navigation-menu"][data-part="indicator"] {
    display: flex;
    justify-content: center;
    height: var(--indicator-size);
    z-index: 1;
    transition:
      translate 250ms ease,
      width 250ms ease;
    overflow: hidden;

    &[data-orientation="horizontal"] {
      left: 0px;
      translate: var(--trigger-x) 0;
      top: calc(var(--indicator-size) * -1);
      width: var(--trigger-width);
    }

    &[data-orientation="vertical"] {
      top: 0px;
      left: calc(var(--indicator-size) * -1);
      translate: 0 var(--trigger-y);
      height: var(--trigger-height);
    }

    &[data-state="open"] {
      animation: nav-menu-fade-in 250ms ease;
    }

    &[data-state="closed"] {
      animation: nav-menu-fade-out 250ms ease;
    }
  }
}
